<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import waybillSeaServiceTaskType from '@/api/sea/waybillSeaServiceTaskType'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'waybill_sea_service_task_type',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: true,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'drawer',
    width: 600
  },
  api: waybillSeaServiceTaskType.getList,
  add: {
    show: true,
    api: waybillSeaServiceTaskType.save,
    auth: ['sea:waybillServiceTaskType:save']
  },
  edit: {
    show: true,
    api: waybillSeaServiceTaskType.update,
    auth: ['sea:waybillServiceTaskType:update']
  },
  delete: {
    show: true,
    api: waybillSeaServiceTaskType.deletes,
    auth: ['sea:waybillServiceTaskType:delete']
  }
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "服务名称",
    dataIndex: "name",
    formType: "input",
    search: true,
    commonRules: {
      required: true,
      message: "请输入服务名称"
    }
  },
  {
    title: "状态",
    dataIndex: "status",
    formType: "radio",
      addDefaultValue:1, 
      dict: {
          data:[
              {label:"启用",value:1},
              {label:"禁用",value:0}
          ],
          translation: true
      },
    commonRules: {
      required: true,
      message: "请输入状态"
    }
  },
  {
    title: "包含站内任务",
    dataIndex: "type",
    formType: "radio",
      addDefaultValue:0, 
      dict: {
          data:[
              {label:"是",value:1},
              {label:"否",value:0}
          ],
          translation: true
      },
    search: true,
    commonRules: {
      required: true,
      message: "请输入是否包含站内任务"
    }
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "描述",
    dataIndex: "describe",
    formType: "textarea",
    // search: true
  },
  {
    title: "备注",
    dataIndex: "remark",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  }
])
</script>
<script> export default { name: 'sea:waybillServiceTaskType' } </script>